import React from "react"
import { AtModal } from "taro-ui"
import { Image, View } from "@tarojs/components"
import "./index.scss"
import emptyImg from "../../assets/images/empty.png"

export default function ({ isOpened, children, confirmText, onConfirm, cancelText, onCancel, titleText, className }) {
  return (
    <AtModal
      isOpened={isOpened}
      className={`component-modal ${className}`}
      onClose={e => {
        onCancel()
      }}
    >
      <View className="submit-detail-title">{titleText}</View>
      <View className="submit-detail-main">{children}</View>
      <View className="modal-btns">
        <View className="modal-btn modal-cancel" onClick={onCancel}>
          {cancelText}
        </View>
        <View className="modal-btn modal-confirm" onClick={onConfirm}>
          {confirmText}
        </View>
      </View>
    </AtModal>
  )
}
